/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.oimwrapper.testers;

import com.thortech.util.logging.Logger;
import java.util.Map;
import org.junit.Test;
import org.oimwrapper.connectors.OIMAdapterBase;
import org.oimwrapper.connectors.OIMRemoteClientBase;

/**
 *
 */
public class ClientDBConnectTester extends ClientBaseTester {

    private static final Logger logger = Logger.getLogger(ClientDBConnectTester.class.getName());

    private static OIMAdapterBase apiBase;
    private OIMRemoteClientBase client = null;

    @Test
    public void mainTest()
    {
        try
        {
            client = this.connect();
            apiBase = client.getUtils();
        }
        catch(Exception e)
        {
            logger.error("Connection Failed",e);
            return;
        }

        try
        {

            Map[] records = apiBase.getOimData("select USR_LOGIN FROM USR");
            if (records != null)
            {
                for(Map record : records)
                {
                    logger.debug("Record " + record);
                }
            }
        }
        catch(Exception e)
        {
            logger.error("Exception",e);
        }
        
    }

}
